package com.cn.hangyun.controller;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cn.hangyun.common.DateUtil;
import com.cn.hangyun.model.Rt_pull_control;
import com.cn.hangyun.model.Rt_pull_transducer;
import com.cn.hangyun.model.requestVO.PullRequestBean;
import com.cn.hangyun.service.IPullService;


@Controller
@RequestMapping("/pull")
public class PullController {

	@Autowired
	private IPullService pullService;

	/**
	 * 
	 * @return
	 */
	@RequestMapping("/pullTrans")
	@ResponseBody
	public List<Rt_pull_transducer> getPullTranas() {
		
		List<Rt_pull_transducer> list = pullService.getAllPullTran();
		return list;
	}
	
	/**
	 * 
	 * @param current
	 * @return
	 */
	@RequestMapping("/pullControl")
	@ResponseBody
	public Rt_pull_control getAccControl(Date current) {
		
		Rt_pull_control result = pullService.getLastPullControl(current);
		return result;
	}

	/**
	 * 
	 * @param bean
	 * @return
	 */
	@RequestMapping(value="/pullData", method=RequestMethod.POST)
	@ResponseBody
	public Map<String, List<String>> getPullData(PullRequestBean bean) {
		
	     Map<String, List<String>> result = pullService.getPullData(bean);
	     return result;
	}
	
}
